// 抽象飞机类
abstract class Aircraft {
    protected int weight; // 自重
    protected int flightHeight; // 飞行高度

    public Aircraft(int weight, int flightHeight) {
        this.weight = weight;
        this.flightHeight = flightHeight;
    }

    // 起飞
    public abstract void takeOff();
    // 加速
    public abstract void accelerate();
    // 降落
    public abstract void land();
}

// 客机类
class PassengerPlane extends Aircraft {
    private int seatCount; // 座位数

    public PassengerPlane(int weight, int flightHeight, int seatCount) {
        super(weight, flightHeight);
        this.seatCount = seatCount;
    }

    @Override
    public void takeOff() {
        System.out.println("客机起飞，座位数：" + seatCount);
    }

    @Override
    public void accelerate() {
        System.out.println("客机加速");
    }

    @Override
    public void land() {
        System.out.println("客机降落");
    }
}

// 战斗机类
class FighterJet extends Aircraft {
    private int missileCount; // 弹头数

    public FighterJet(int weight, int flightHeight, int missileCount) {
        super(weight, flightHeight);
        this.missileCount = missileCount;
    }

    @Override
    public void takeOff() {
        System.out.println("战斗机起飞，弹头数：" + missileCount);
    }

    @Override
    public void accelerate() {
        System.out.println("战斗机加速");
    }

    @Override
    public void land() {
        System.out.println("战斗机降落");
    }

    // 发射导弹
    public void launchMissiles() {
        System.out.println("战斗机发射导弹");
    }

    // 低空盘旋
    public void lowAltitudeCircle() {
        System.out.println("战斗机低空盘旋");
    }
}

// 飞行员类
class Pilot {
    public void testFly(Aircraft aircraft) {
        aircraft.takeOff();
        aircraft.accelerate();
        aircraft.land();
    }

    // 驾驶客机和战斗机
    public void drive(Aircraft aircraft) {
        if (aircraft instanceof PassengerPlane) {
            System.out.println("驾驶客机");
        } else if (aircraft instanceof FighterJet) {
            System.out.println("驾驶战斗机");
            ((FighterJet) aircraft).launchMissiles();
            ((FighterJet) aircraft).lowAltitudeCircle();
        }
    }
}

// 测试类
public class TestFlight {
    public static void main(String[] args) {
        Pilot pilot = new Pilot();

        // 测试客机
        PassengerPlane passengerPlane = new PassengerPlane(100000, 30000, 200);
        pilot.testFly(passengerPlane);
        pilot.drive(passengerPlane);

        // 测试战斗机
        FighterJet fighterJet = new FighterJet(50000, 20000, 10);
        pilot.testFly(fighterJet);
        pilot.drive(fighterJet);
    }
}